/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package src.services.customer;

/**
 *
 * @author jay
 */

import src.domain.customer.Province;
import java.util.List;
import java.util.Map;
import javax.faces.model.SelectItem;
import src.services.CRUEDService;

public class ProvinceModel implements java.io.Serializable {
        
    private CRUEDService service;
    
    public ProvinceModel() {
        service = new CRUEDService();
    }
    
    public List<Province> findAll(Map<String, String> filters) {
        return (List<Province>) service.findAll("Province", filters);
    }

    public List<SelectItem> listAll() {
        return service.listAll("Province", "provinceId", "provinceName");
    }
    
     public List<SelectItem> listAll(Map<String, String> filters) {
        //ini utk kebutuhan combo change aja
         //return service.listAll("src.domain.customer.Province as tb inner join tb.country as tc", "provinceId", "provinceName",filters);
         return service.listAll("Province as tb", "provinceId", "provinceName",filters);
    }
    
    public boolean saveData(Province data) {
        return service.saveData(data);
    }
    
    public boolean deleteData(Province data) {
        return service.deleteData(data);
    }
}
